<?php


namespace app\controller\admin\finance;


use app\controller\admin\BaseAdminController;
use app\model\user\PartnerMoneyRecordModel;
use app\service\user\PartnerMoneyRecordService;

class PartnerMoneyRecordController extends BaseAdminController
{

    function setModel()
    {
        return new PartnerMoneyRecordModel();
    }

    function setWithModel()
    {
        return ['partner'];
    }

    function setSearch()
    {

        return [
            'like' => ['order_sn', 'partner.mobile' => 'user_info'],
            '=' => ['type'],
        ];
    }

    function setSort()
    {
        // TODO: Implement setSort() method.
    }

    /**
     * 变更记录
     * @return \think\response\Json
     */
    public function getBalanceType()
    {
        try {
            $detailMoneyService = new PartnerMoneyRecordService();
            $list = $detailMoneyService->getTypeArr();
            return $this->success($list);
        } catch (\Exception $exception) {
            return $this->error($exception);
        }
    }
}